package com.atguigu.controller;

import sun.misc.Unsafe;

import java.lang.reflect.Field;

public class MyTest {
    public static void main(String[] args) throws NoSuchFieldException, IllegalAccessException, InstantiationException {
        Field theUnsafe = Unsafe.class.getDeclaredField("theUnsafe");
        theUnsafe.setAccessible(true);
        Unsafe o = (Unsafe) theUnsafe.get(null);
        Demo o1 = (Demo) o.allocateInstance(Demo.class);
        System.out.println(o1);
    }
}
